// 此模块为models出口文件
// 模型层  进行数据的管理操作MVC  MVVM  ->  model

import { HTTP } from '../utils/http';
import {API} from '../utils/config';

class DetailModel extends HTTP {
  getDetail (field, id) {
    return new Promise((resolve, reject) => {
      this.axiosPost({
        url: API.GET_DETAIL,
        data: {
          field,
          id,
        },
        success(data) {
          resolve({
            data,
            status: 0,
          });
        },
        error(err) {
          resolve({
            status: -1,
          });
        },
      });
    })
  }
}

export { DetailModel };
